import pytest
import requests
from send.Send import Send
from utils.read_yaml import read_yaml
from utils.DButils import *

#先登录，再实现操作，没有实现登录 cookie?
class Test_bankcard_delete:

    @pytest.mark.parametrize( "args", read_yaml("D:/Projects/接口自动化/data/bankcard_delete.yaml")  )
    def  test_bankcard_delete(self,args):
        pre_sql = args["pre_sql"]
        update(pre_sql)

        se = Send()
        login_username = args["username"]
        session  = se.ceshi_buy_login(login_username)
        exp = args["exp"]

        result = se.send_bankcard_delete(session,args)
        assert result["code"] == 200 and result["body"]["code"] == exp